package cn.biplam.back.bean.ddl.sql2db.pk;

import cn.biplam.back.sql.ddl.PK;
import cn.biplam.back.sql.ddl.Table;

public class PkCommen {
	
	public String get(Table table){
		PK mPK = table.getPK();
		if(mPK==null){
			return null;
		}
		StringBuilder sb = new StringBuilder();
		
		sb.append(" alter table "+table.getPhysicalName()+"\n\t ");
		sb.append(" add primary key ("+mPK.getColumnNames());
		sb.append(" );\n");
		return sb.toString();
	}
}
